vcUnitFamily

Unit family is a collection of units that belong to the same system of measurements. This unit family concept is not a strict definition rather a way to simplify unit selection.

See in: Overview

Module: vcCore

Parent: vcObject

Children -

Referenced by: vcUnitManager.CurrentUnitFamily, vcUnitManager.UnitFamilies, vcUnitManager.createUnitFamily(), vcUnitManager.findUnitFamily()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
GroupsvcList[vcUnitGroup]RGets a list of all unit groups in unit family.
IsBuiltInBooleanRGets a value which defines if the unit family is a built-in type.
See more
If True, adding and removing custom unit groups from unit family is allowed but not for built-in unit groups.
NameStringRWGets or sets unit family name.

Exceptions:
ValueError: When given name is empty or not unique.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
addGroupIntegervcUnitGroup groupAdds a given unit group to unit family.
See more
Parameters:
group (vcUnitGroup): A unit group to add to the unit family.

Returns:
Integer: Returns the index of the unit group in unit family.
containsGroupBooleanvcUnitGroup groupReturns True if a given unit group is in the unit family; otherwise returns False.
See more
Parameters:
group (vcUnitGroup): A unit group to search for in the current unit family.

Returns:
Boolean: Returns True if this unit family contains given unit group; otherwise False.
deleteNoneNoneDeletes the unit family.

Exceptions:
RuntimeError: When deleting a built-in unit family object.
removeGroupBooleanvcUnitGroup groupRemoves a given unit group from unit family.
See more
Parameters:
group (vcUnitGroup): A unit group to add to remove from unit family.

Exceptions:
ValueError: When current unit family and given unit group are built-in.

Returns:
Boolean: Returns True if removal was successful, otherwise False.